#ifndef _TJMATH6282011_H_
#define _TJMATH6282011_H_
#include <cmath>
#include <climits>

#define FLOAT_INF 100000000000000000.0f
#define FLOAT_ZERO_THRESHOLD 0.000001f

template <typename T>
bool is_zero(T x) {
	return x == 0;
}

template <>
bool is_zero<float>(float x) {
	return (fabs(x) < FLOAT_ZERO_THRESHOLD);
}

template <typename T>
bool is_equal(T x, T y) {
	return x == y;
}

template <>
bool is_equal<float>(float x, float y) {
	return (fabs(x - y) < FLOAT_ZERO_THRESHOLD);
}
#endif //_TJMATH6282011_H_